package com.neusoft.resturant.controller;

import com.neusoft.resturant.service.ResWebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController

public class ChatController {

        @RequestMapping("/push/{toUserId}")
        public ResponseEntity<String> pushToWeb(String message, @PathVariable String toUserId) throws IOException {
            ResWebSocketServer.sendInfo(message,toUserId);
            return ResponseEntity.ok("消息发送失败");
        }
    }



